package km.orm.pojo_persistence;
 
import km.orm.pojo.YJ_EVE;
import java.sql.Date;
import java.sql.Time;
import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.text.DateFormat;
import java.math.BigDecimal;
import com.lonwin.kmorm.baseobject.InstanceIdentity;
import com.lonwin.kmorm.baseobject.PersistenceCapable;
import com.lonwin.kmorm.baseobject.StateManager;
import com.lonwin.kmorm.config.ErMappingConfiguration;
import com.lonwin.kmorm.exception.OrmException;
import com.lonwin.kmorm.state.InstanceType;
import com.lonwin.kmorm.state.PersistenceState;
 
public class Persistence_YJ_EVE extends YJ_EVE implements PersistenceCapable {
    private StateManager stateManager = new StateManager(PersistenceState.TRANSIENT);
    private InstanceIdentity instanceIdentity = new InstanceIdentity();
    public boolean isNewDeleted() {
        return stateManager.isNewDeleted();
    }
    public boolean isDeleted() {
        return stateManager.isDeleted();
    }
    public boolean isClean() {
        return stateManager.isClean();
    }
    public boolean isDirty() {
        return stateManager.isDirty();
    }
    public boolean isNew() {
        return stateManager.isNew();
    }
    public boolean isTransient() {
        return stateManager.isTransient();
    }
    public boolean isHollow() {
        return stateManager.isHollow();
    }
    public boolean isMainInstance() {
        return this.instanceIdentity.getInstanceType()==InstanceType.MAIN;
    }
    public boolean ifModifyPriKey(ErMappingConfiguration erMappingConfiguration) throws OrmException {
        return this.instanceIdentity.ifModifyPriKey( this, erMappingConfiguration );
    }
    public void makeNewDeleted() {
        stateManager.makeNewDeleted();
    }
    public void makeDeleted() {
        stateManager.makeDeleted();
    }
    public void makeClean() {
        stateManager.makeClean();
    }
    public void makeDirty() {
        stateManager.makeDirty();
    }
    public void makeNew() {
        stateManager.makeNew();
    }
    public void makeTransient() {
        stateManager.makeTransient();
    }
    public void makeHollow() {
        stateManager.makeHollow();
    }
    public InstanceIdentity getInstanceIdentity() {
        return this.instanceIdentity;
    }
    public void generateInstanceIndentity(ErMappingConfiguration erMappingConfiguration) throws OrmException {
        this.instanceIdentity.generateIndentityValue(this, erMappingConfiguration );
    }
    public boolean canMakeDirty() {
        return this.stateManager.isClean();
    }
    public void setMainInstance() {
        this.instanceIdentity.setInstanceType(InstanceType.MAIN);
    }
    public void setSubordinationInstance() {
        this.instanceIdentity.setInstanceType((InstanceType.SUBORDINATION));
    }
    public void setEve_xgpg(String eve_xgpg) {
      super.setEve_xgpg(eve_xgpg);
      if(canMakeDirty()) {
          this.stateManager.makeDirty();
          this.instanceIdentity.setInstanceType(InstanceType.MAIN);
      }
    }
    public void setEve_addr(String eve_addr) {
      super.setEve_addr(eve_addr);
      if(canMakeDirty()) {
          this.stateManager.makeDirty();
          this.instanceIdentity.setInstanceType(InstanceType.MAIN);
      }
    }
    public void setWater_deg(String water_deg) {
      super.setWater_deg(water_deg);
      if(canMakeDirty()) {
          this.stateManager.makeDirty();
          this.instanceIdentity.setInstanceType(InstanceType.MAIN);
      }
    }
    public void setEve_gs(String eve_gs) {
      super.setEve_gs(eve_gs);
      if(canMakeDirty()) {
          this.stateManager.makeDirty();
          this.instanceIdentity.setInstanceType(InstanceType.MAIN);
      }
    }
    public void setEve_type(String eve_type) {
      super.setEve_type(eve_type);
      if(canMakeDirty()) {
          this.stateManager.makeDirty();
          this.instanceIdentity.setInstanceType(InstanceType.MAIN);
      }
    }
    public void setEve_method(String eve_method) {
      super.setEve_method(eve_method);
      if(canMakeDirty()) {
          this.stateManager.makeDirty();
          this.instanceIdentity.setInstanceType(InstanceType.MAIN);
      }
    }
    public void setEve_dre(String eve_dre) {
      super.setEve_dre(eve_dre);
      if(canMakeDirty()) {
          this.stateManager.makeDirty();
          this.instanceIdentity.setInstanceType(InstanceType.MAIN);
      }
    }
    public void setEve_cd(String eve_cd) {
      super.setEve_cd(eve_cd);
      if(canMakeDirty()) {
          this.stateManager.makeDirty();
          this.instanceIdentity.setInstanceType(InstanceType.MAIN);
      }
    }
    public void setEve_nm(String eve_nm) {
      super.setEve_nm(eve_nm);
      if(canMakeDirty()) {
          this.stateManager.makeDirty();
          this.instanceIdentity.setInstanceType(InstanceType.MAIN);
      }
    }
    public void setRec_dt(Date rec_dt) {
      super.setRec_dt(rec_dt);
      if(canMakeDirty()) {
          this.stateManager.makeDirty();
          this.instanceIdentity.setInstanceType(InstanceType.MAIN);
      }
    }
    public void setRec_nm(String rec_nm) {
      super.setRec_nm(rec_nm);
      if(canMakeDirty()) {
          this.stateManager.makeDirty();
          this.instanceIdentity.setInstanceType(InstanceType.MAIN);
      }
    }
    public void setEve_dt(Date eve_dt) {
      super.setEve_dt(eve_dt);
      if(canMakeDirty()) {
          this.stateManager.makeDirty();
          this.instanceIdentity.setInstanceType(InstanceType.MAIN);
      }
    }
}
